<script type="text/javascript" >
    jQuery(document).ready(function(){
        jQuery('.stExtra').remove();
    });
    stFacebookToolbox.load_tooltip();
    stFacebookToolbox.loadUploadButton('200');
    stFacebookToolbox.loadRemoveButton();
        jQuery("a[rel^='prettyPhoto']").prettyPhoto({
            theme:'facebook',
            default_height:100,
            keyboard_shortcuts: false
        });
function make_pdf(){
    window.open('<?php echo get_bloginfo('url');?>/coupon/user_export.php?campaign=<?php echo $template_id;?>&format=pdf&sort=Name&popup=true&user=<?php echo $user;?>');
}
</script>
<style>
    th.column-CouponUserID {
        width:70px;
    }
</style>
<div class="w100p bgl" id="stcontainer">
    <div class="w100p bgr p5b" id="result">
        
 <img src="<?php echo $config['imagesUrl'];?>pdf.png" style="cursor:pointer;" onclick="make_pdf();" /> 
 <p></p>
<table class="widefat" cellspacing="0">
                <thead>
                    <tr>
                        <?php print_column_headers('stFacebookToolbox_stFacebookToolbox'); ?>
                    </tr>
                </thead>

                <tbody>
                <?php
                if (count($results) > 0) {
                    
                    $tr_class = "";
                    $upload_data = wp_upload_dir();
                    foreach ($results as $result) {
                       
                       // $description  = (strlen($result->CouponTemplateDescription) > 35)?substr($result->CouponTemplateDescription,0,35).'...':$result->CouponTemplateDescription;
                        if( empty($tr_class) || $tr_class == "class='bg_gray2'"){
                            $tr_class = "class='bg_gray1'";
                        }else{
                            $tr_class = "class='bg_gray2'";
                        }
                        echo "<tr id='$result->CouponUserID 	' $tr_class >"
                        . "<td>" 
                        . $result->CouponUserID
                        . "</td>"
                        . "<td>"
                        . $result->Name
                        . "</td>"
                        . "<td>"
                        . $campain
                        . "</td>"
                        . "<td>"
                        . $model->get_date($result->CouponUserID)
                        .  "</td>"
                        . "<td>No"
                        . "</td>"
                          

                        . "</td>"
                        
                        . "</tr>"
                        ;
                    }
                }
                ?>
                </tbody>
            </table>
            <div class="page_d">
                <?php echo $pagination?>
                <div class="cl"></div>
            </div>
    </div>
</div>